]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Don't activate workspace when more than one window is open
authorAdel Gadllah <adel.gadllah@gmail.com>
Sun, 7 Mar 2010 18:33:58 +0000 (19:33 +0100)
committerAdel Gadllah <adel.gadllah@gmail.com>
Tue, 9 Mar 2010 21:35:51 +0000 (22:35 +0100)
Currently clicking on an empty spot on the workspace actors switches to the workspace, this has a side effect that when for some reason (like using a touchpad),
the user misses the window he intends to open he will end up with the currently focused window instead.

Disable this behaviour if more than one window is open (in that case the user has to explicitly target a specific window).

https://bugzilla.gnome.org/show_bug.cgi?id=610868

js/ui/workspace.js

index 4c440dec898e077770e1f0485b79fd9e90e48e22..4d9bf30c4c3f66e9316b219803333b7d0fb2b7a9 100644 (file)
@@ -639,8 +639,13 @@ Workspace.prototype = {
         this._desktop.connect('selected',
                               Lang.bind(this,
                                         function(clone, time) {
-                                            this._metaWorkspace.activate(time);
-                                            Main.overview.hide();
+                                            // Only switch to the workspace when one window is open
+                                            // We check for "2" here because the Desktop does not really count
+                                            // as a window in this context.
+                                            if (this._windows.length <= 2) {
+                                                this._metaWorkspace.activate(time);
+                                                Main.overview.hide();
+                                            }
                                         }));
         this.actor.add_actor(this._desktop.actor);